#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int x,y,f[1<<20];
int main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	cin>>x>>y;
	f[x]=1;
	for(int i=x;i<y;++i){
		(f[i+1]+=f[i])%=mod;
		(f[i*2]+=f[i])%=mod;
	}cout<<f[y];
	return 0;
}


